/*****************************************************************************
 * 
 * Copyright [2013] [Mervin.Wong]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 *       
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *  
 *****************************************************************************/
package base.feature;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

import base.Network;

/**
 *@name InterfaceDegree.java
 *@description 
 *@author 王进法<Mervin.Wong>
 *@version 
 *@Date 2013-1-12下午5:01:06
 */
/*********************************************************************************
 * 4, int nodeDegree(nodeId)//节点的度
 * 5, int nodeInDegree(nodeId)//节点的入度，有向网
 * 6, int nodeOutDegree(nodeId)//节点的出度，有向网
 * 7, HashMap<Number,Number> netDegreeDistribution(network net)//度分布
 ********************************************************************************/
public interface InterfaceDegree {

	/**
	 * @name nodeDegree
	 * @description 单个节点的度
	 * @param nodeId
	 * @return int degree
	 */
	public int nodeDegree(Number nodeId);
	
	/**
	 * @name nodeDegree
	 * @description 单个节点的度
	 * @param Network net
	 * @param nodeId
	 * @return int degree
	 */
	public int nodeDegree(Network net, Number nodeId);
	
	/**
	 * @name nodesDegree
	 * @description 获取多个节点的度
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> degrees
	 */
	public HashMap<Number,Number> nodesDegree(Set<Number> nodeIdSet);
	
	/**
	 * @name nodesDegree
	 * @description 获取多个节点的度
	 * @param Network net
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> degrees
	 */
	public HashMap<Number, Number> nodesDegree(Network net, Set<Number> nodeIdSet);
	
	/**
	 * @name nodeInDegree
	 * @description 节点的入度
	 * @param nodeId
	 * @return int inDegree
	 */
	public int nodeInDegree(Number nodeId);
	
	/**
	 * @name nodeInDegree
	 * @description 节点的入度
	 * @param Network net
	 * @param nodeId
	 * @return int inDegree
	 */
	public int nodeInDegree(Network net, Number nodeId);
	
	/**
	 * @name nodesInDegree
	 * @description 多个节点的入度
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> inDegrees
	 */
	public HashMap<Number,Number> nodesInDegree(HashSet<Number> nodeIdSet); 
	
	/**
	 * @name nodesInDegree
	 * @description 多个节点的入度
	 * @param Network net
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> inDegrees
	 */
	public HashMap<Number,Number> nodesInDegree(Network net, HashSet<Number> nodeIdSet); 
	
	/**
	 * 
	 * @name nodeOutDegree
	 * @description 单个节点的出度
	 * @param nodeId
	 * @return int outDegree
	 */
	public int nodeOutDegree(Number nodeId);
	
	/**
	 * 
	 * @name nodeOutDegree
	 * @description 单个节点的出度
	 * @param Network net
	 * @param nodeId
	 * @return int outDegree
	 */
	public int nodeOutDegree(Network net, Number nodeId);
	
	/**
	 * @name nodesOutDegree
	 * @description 多个节点的出度
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> outDegrees
	 */
	public HashMap<Number,Number> nodesOutDegree(HashSet<Number> nodeIdSet); 
	
	/**
	 * @name nodesOutDegree
	 * @description 多个节点的出度
	 * @param Network net
	 * @param nodeIdSet
	 * @return HashMap<Number,Number> outDegrees
	 */
	public HashMap<Number,Number> nodesOutDegree(Network net, HashSet<Number> nodeIdSet); 

	/**
	 * @name nodesDegreeMax
	 * @description 节点集合中度的最大值
	 * @return
	 */
	public int nodesDegreeMax(HashMap<Number, Number> degreeMap);
	/**
	 * @name netDegreeMax
	 * @description 获取网络度的最大值
	 * @return
	 */
	public int netDegreeMax();
	
	/**
	 * @name netDegreeMax
	 * @description 获取网络net的度最大值
	 * @param net
	 * @return
	 */
	public int netDegreeMax(Network net);
	
	/**
	 * @name netDegreeDistribution
	 * @description 网络的度分布
	 * @return HashMap<Integer,Integer> degreeDistribution
	 */
	public HashMap<Number, Number> netDegreeDistribution();
	
	/**
	 * @name netDegreeDistribution
	 * @description 网络的度分布
	 * @param net
	 * @return HashMap<Number, Number> degreeDistribution
	 */
	public HashMap<Number, Number> netDegreeDistribution(Network net);
	
	/**
	 * @name netDegreeDistributionRate
	 * @description 网络的度分布率
	 * @return HashMap<Number, Number> degreeDistribution
	 */
	public HashMap<Number, Number> netDegreeDistributionRate();
	
	/**
	 * @name netDegreeDistributionRate
	 * @description 网络的度分布率
	 * @param net
	 * @return HashMap<Number, Number> degreeDistribution
	 */
	public HashMap<Number, Number> netDegreeDistributionRate(Network net);
	
	/**
	 * @name netDegreeAvg
	 * @description 网络度的平均值
	 * @return
	 */
	public float netDegreeAvg();
	
	/**
	 * @name netDegreeAvg
	 * @description 网络度的平均值
	 * @param net
	 * @return
	 */
	public float netDegreeAvg(Network net);
}
